package com.mxsoft.ssmdemo.service.impl;

import com.mxsoft.ssmdemo.mapper.FooMapper;
import com.mxsoft.ssmdemo.model.Foo;
import com.mxsoft.ssmdemo.service.IFooService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhangyingxuan
 */
@Service
public class FooServiceImpl implements IFooService {

    @Autowired
    private FooMapper fooMapper;

    @Override
    public int add(Foo foo) {
        return fooMapper.insert(foo);
    }

    @Override
    public int edit(Foo foo) {
        return fooMapper.update(foo);
    }

    @Override
    public int delete(Long id) {
        return fooMapper.delete(id);
    }

    @Override
    public List<Foo> findAll() {
        return fooMapper.findAll();
    }

    @Override
    public Foo findById(Long id) {
        return fooMapper.findById(id);
    }
}
